3.2.100 \(\int \frac {\cot ^2(a+i \log (x))}{x^3} \, dx\) [200]

Optimal. Leaf size=57 \[ \frac {2 e^{-2 i a}}{1-\frac {e^{2 i a}}{x^2}}+\frac {1}{2 x^2}+2 e^{-2 i a} \log \left (1-\frac {e^{2 i a}}{x^2}\right ) \]

[Out]

2/exp(2*I*a)/(1-exp(2*I*a)/x^2)+1/2/x^2+2*ln(1-exp(2*I*a)/x^2)/exp(2*I*a)

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {4592, 455, 45} \begin {gather*} \frac {2 e^{-2 i a}}{1-\frac {e^{2 i a}}{x^2}}+2 e^{-2 i a} \log \left (1-\frac {e^{2 i a}}{x^2}\right )+\frac {1}{2 x^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cot[a + I*Log[x]]^2/x^3,x]

[Out]

2/(E^((2*I)*a)*(1 - E^((2*I)*a)/x^2)) + 1/(2*x^2) + (2*Log[1 - E^((2*I)*a)/x^2])/E^((2*I)*a)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 455

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] && NeQ[b*c - a*d, 0] && EqQ[m
- n + 1, 0]

Rule 4592

Int[Cot[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.)*((e_.)*(x_))^(m_.), x_Symbol] :> Int[(e*x)^m*((-I - I*E^(2*I*a*d)
*x^(2*I*b*d))/(1 - E^(2*I*a*d)*x^(2*I*b*d)))^p, x] /; FreeQ[{a, b, d, e, m, p}, x]

Rubi steps

\begin {align*} \int \frac {\cot ^2(a+i \log (x))}{x^3} \, dx &=\int \frac {\cot ^2(a+i \log (x))}{x^3} \, dx\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(153\) vs. \(2(57)=114\).
time = 0.17, size = 153, normalized size = 2.68 \begin {gather*} \frac {1}{2 x^2}+\cos (2 a) \left (-4 \log (x)+\log \left (1+x^4-2 x^2 \cos (2 a)\right )\right )+\frac {2 \cos (a)}{\left (-1+x^2\right ) \cos (a)-i \left (1+x^2\right ) \sin (a)}+\frac {2 \sin (a)}{i \left (-1+x^2\right ) \cos (a)+\left (1+x^2\right ) \sin (a)}+\text {ArcTan}\left (\frac {\cot (a)-x^2 \cot (a)}{1+x^2}\right ) (-2 i \cos (2 a)-4 \cos (a) \sin (a))+4 i \log (x) \sin (2 a)-i \log \left (1+x^4-2 x^2 \cos (2 a)\right ) \sin (2 a) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cot[a + I*Log[x]]^2/x^3,x]

[Out]

1/(2*x^2) + Cos[2*a]*(-4*Log[x] + Log[1 + x^4 - 2*x^2*Cos[2*a]]) + (2*Cos[a])/((-1 + x^2)*Cos[a] - I*(1 + x^2)
*Sin[a]) + (2*Sin[a])/(I*(-1 + x^2)*Cos[a] + (1 + x^2)*Sin[a]) + ArcTan[(Cot[a] - x^2*Cot[a])/(1 + x^2)]*((-2*
I)*Cos[2*a] - 4*Cos[a]*Sin[a]) + (4*I)*Log[x]*Sin[2*a] - I*Log[1 + x^4 - 2*x^2*Cos[2*a]]*Sin[2*a]

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 53, normalized size = 0.93

method result size
risch \(\frac {1}{2 x^{2}}-\frac {2}{x^{2} \left (\frac {{\mathrm e}^{2 i a}}{x^{2}}-1\right )}+2 \,{\mathrm e}^{-2 i a} \ln \left ({\mathrm e}^{2 i a}-x^{2}\right )-4 \,{\mathrm e}^{-2 i a} \ln \left (x \right )\) \(53\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(a+I*ln(x))^2/x^3,x,method=_RETURNVERBOSE)

[Out]

1/2/x^2-2/x^2/(exp(2*I*a)/x^2-1)+2*exp(-2*I*a)*ln(exp(2*I*a)-x^2)-4*exp(-2*I*a)*ln(x)

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(a+I*log(x))^2/x^3,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: THROW: The catch RAT-ERR is undefined.

________________________________________________________________________________________

Fricas [A]
time = 2.87, size = 81, normalized size = 1.42 \begin {gather*} \frac {5 \, x^{2} e^{\left (2 i \, a\right )} + 4 \, {\left (x^{4} - x^{2} e^{\left (2 i \, a\right )}\right )} \log \left (x^{2} - e^{\left (2 i \, a\right )}\right ) - 8 \, {\left (x^{4} - x^{2} e^{\left (2 i \, a\right )}\right )} \log \left (x\right ) - e^{\left (4 i \, a\right )}}{2 \, {\left (x^{4} e^{\left (2 i \, a\right )} - x^{2} e^{\left (4 i \, a\right )}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(a+I*log(x))^2/x^3,x, algorithm="fricas")

[Out]

1/2*(5*x^2*e^(2*I*a) + 4*(x^4 - x^2*e^(2*I*a))*log(x^2 - e^(2*I*a)) - 8*(x^4 - x^2*e^(2*I*a))*log(x) - e^(4*I*
a))/(x^4*e^(2*I*a) - x^2*e^(4*I*a))

________________________________________________________________________________________

Sympy [A]
time = 0.28, size = 60, normalized size = 1.05 \begin {gather*} - \frac {- 5 x^{2} + e^{2 i a}}{2 x^{4} - 2 x^{2} e^{2 i a}} - 4 e^{- 2 i a} \log {\left (x \right )} + 2 e^{- 2 i a} \log {\left (x^{2} - e^{2 i a} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(a+I*ln(x))**2/x**3,x)

[Out]

-(-5*x**2 + exp(2*I*a))/(2*x**4 - 2*x**2*exp(2*I*a)) - 4*exp(-2*I*a)*log(x) + 2*exp(-2*I*a)*log(x**2 - exp(2*I
*a))

________________________________________________________________________________________

Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 190 vs. \(2 (42) = 84\).
time = 0.45, size = 190, normalized size = 3.33 \begin {gather*} \frac {2 \, x^{4} \log \left (x^{2} - e^{\left (2 i \, a\right )}\right )}{x^{4} e^{\left (2 i \, a\right )} - x^{2} e^{\left (4 i \, a\right )}} - \frac {4 \, x^{4} \log \left (x\right )}{x^{4} e^{\left (2 i \, a\right )} - x^{2} e^{\left (4 i \, a\right )}} - \frac {2 \, x^{2} e^{\left (2 i \, a\right )} \log \left (x^{2} - e^{\left (2 i \, a\right )}\right )}{x^{4} e^{\left (2 i \, a\right )} - x^{2} e^{\left (4 i \, a\right )}} + \frac {4 \, x^{2} e^{\left (2 i \, a\right )} \log \left (x\right )}{x^{4} e^{\left (2 i \, a\right )} - x^{2} e^{\left (4 i \, a\right )}} + \frac {5 \, x^{2} e^{\left (2 i \, a\right )}}{2 \, {\left (x^{4} e^{\left (2 i \, a\right )} - x^{2} e^{\left (4 i \, a\right )}\right )}} - \frac {e^{\left (4 i \, a\right )}}{2 \, {\left (x^{4} e^{\left (2 i \, a\right )} - x^{2} e^{\left (4 i \, a\right )}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(a+I*log(x))^2/x^3,x, algorithm="giac")

[Out]

2*x^4*log(x^2 - e^(2*I*a))/(x^4*e^(2*I*a) - x^2*e^(4*I*a)) - 4*x^4*log(x)/(x^4*e^(2*I*a) - x^2*e^(4*I*a)) - 2*
x^2*e^(2*I*a)*log(x^2 - e^(2*I*a))/(x^4*e^(2*I*a) - x^2*e^(4*I*a)) + 4*x^2*e^(2*I*a)*log(x)/(x^4*e^(2*I*a) - x
^2*e^(4*I*a)) + 5/2*x^2*e^(2*I*a)/(x^4*e^(2*I*a) - x^2*e^(4*I*a)) - 1/2*e^(4*I*a)/(x^4*e^(2*I*a) - x^2*e^(4*I*
a))

________________________________________________________________________________________

Mupad [B]
time = 2.23, size = 60, normalized size = 1.05 \begin {gather*} -4\,{\mathrm {e}}^{-a\,2{}\mathrm {i}}\,\ln \left (x\right )+2\,\ln \left (x^2-{\mathrm {e}}^{a\,2{}\mathrm {i}}\right )\,{\mathrm {e}}^{-a\,2{}\mathrm {i}}+\frac {\frac {{\mathrm {e}}^{a\,2{}\mathrm {i}}}{2}-\frac {5\,x^2}{2}}{x^2\,{\mathrm {e}}^{a\,2{}\mathrm {i}}-x^4} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(a + log(x)*1i)^2/x^3,x)

[Out]

2*log(x^2 - exp(a*2i))*exp(-a*2i) - 4*exp(-a*2i)*log(x) + (exp(a*2i)/2 - (5*x^2)/2)/(x^2*exp(a*2i) - x^4)

________________________________________________________________________________________